package code.structure.module.scene.view
{
	import code.structure.manager.loader.DllLoaderManager;
	import code.structure.manager.assist.ProjectAssistManager;
	import code.structure.manager.font.FontManager;
	import code.structure.manager.language.LanguageManager;
	import code.structure.manager.assist.FeedRequestManager;
	import code.structure.module.config.data.MapUnlokData;
	import code.structure.module.config.data.MetaActiveData;
	import code.structure.module.pop.view.Windows;
	import code.structure.module.scene.manager.SceneAlertManager;
	import code.tools.commponents.CloseBtn;
	import code.tools.commponents.Helpers;
	import code.tools.commponents.OriginalInfo;
	import code.tools.commponents.VBox;
	import code.tools.commponents.button.TextButton;
	import code.untils.FiltersEnum;
	import code.untils.SwitchConfig;
	import code.untils.UiNameConst;
	
	import com.greensock.TweenLite;
	
	import flash.display.Bitmap;
	import flash.display.MovieClip;
	import flash.display.Sprite;
	import flash.text.TextField;
	import flash.text.TextFieldAutoSize;

	/**
	 *扩地界面 
	 * @author liangqian
	 * 
	 */	
	public class EnlargeLandView extends Windows
	{
		private static const PAGE_SIZE:int = 3;
		/** 标题   */
		private var titleBm:Bitmap;
		/** 标题遮罩  */
		private var _titleShade:Sprite;
		/** 标题文字 */
		private var _titleTf:TextField;
		
		private var _descTf:TextField;
		/** 完成扩地  按钮*/
		private var completeBtn:TextButton;
		private var enlargeLandItemVec:Vector.<EnlargeLandItem>;
		private var vb:VBox;
		public var _mapUnlockCallBack:Function;
		private var view:MovieClip;
		
		private var skillAllTb:TextButton;
		/** 跳过所有的价格 */
		public var _skipAllCost:int;
		/** 跳过所有原价 */
		private var _skipAllOriginalCost:int;
		
		/** 折扣区域 */
		private var _offArea:Sprite;
		/** 折扣----原跳过所有价格 */
		private var _skipAllPriceArea:OriginalInfo;
		public function EnlargeLandView()
		{
			super();
		}
		
		override protected function appFunction():void
		{
			super.appFunction();
			completeBtn.draw();
		}
		
		override protected function initializePanel():void
		{
			super.initializePanel();
			
			view = new (DllLoaderManager.getInstance().getMaterial(UiNameConst.PANEL_VIEW,'enlargeView')as Class)as MovieClip;
			_mMain.addChild(view);
			/* 标题遮罩  */
			_titleShade = new (DllLoaderManager.getInstance().getMaterial(UiNameConst.PANEL_VIEW,'titleShade_enlargeView')as Class)as Sprite;
			_mMain.addChild(_titleShade);
			_titleTf = Helpers.FormatTextField(null,45,36,_titleShade.width,TextFieldAutoSize.LEFT,0xffffff,FontManager.getInstance().embeddedFontBName,36);
			
			_descTf = view.getChildByName('desc_text')as TextField;
			_descTf = Helpers.replaceTf(_descTf,FontManager.getInstance().embeddedFontCName,true,true);
			/* 扩地的条件  */
			vb = new VBox(_mMain,128,120);
			vb.spacing = 5;
			enlargeLandItemVec = new Vector.<EnlargeLandItem>();
			var i:int;
			var enlargeLandItem:EnlargeLandItem;
			for(; i < PAGE_SIZE; i++)
			{
				enlargeLandItem = new EnlargeLandItem(vb,skipUnlockMapItemHandler,feedHandler,requestHandler,goHandler);
				enlargeLandItem.tag = i;
				enlargeLandItemVec.push(enlargeLandItem);
			}
			skillAllTb = new TextButton(view,0,445,'',skillAllHandler,TextButton.TEXTBUTTON_STYLE_WITH_CASH_BLUE_BIG,-1,-1,-1,TextButton.BTN_FILTERS_NONE);
			skillAllTb.visible = false;
			completeBtn = new TextButton(view,234,445,LanguageManager.getLanguageInfo('BTN_EXPANSION_DONE'),completeHandler,TextButton.TEXTBUTTON_STYLE_GREEN2,177,35);
			completeBtn.visible = false;
			new CloseBtn(_mMain,584,15,closeHandler);
			
			/** 折扣区域 */
			_offArea = view.getChildByName('offArea')as Sprite;
			_offArea.visible = false;
			Helpers.processTf(_offArea,'off_text',LanguageManager.getLanguageInfo('TIPS_LVGIFT3'),FontManager.getInstance().embeddedFontBName,true,true);
			/** 折扣----原跳过所有价格 */
			_skipAllPriceArea = new OriginalInfo(view.getChildByName('skipAllPriceArea')as Sprite,LanguageManager.getLanguageInfo('DESC_ORIGINAL_CASH'));
			appearFactory(1,1);
		}
		
		override public function get height():Number
		{
			return 538;
		}
		
		override public function get width():Number
		{
			return 655;
		}
		
		private function closeHandler(...args):void
		{
			disappear();
		}
		
		private var _dataProvider:MapUnlokData;
		private var _completeCount:int;
		public function set dataProvider(d:MapUnlokData):void
		{
			_dataProvider = d;
			if(d == null)
			{
				disappear();
				return;
			}
			/* 设置标题  */
			_titleTf.text = d.map_block_name;
			titleBm = Helpers.drawConvertBm(titleBm,_titleTf);
			titleBm.cacheAsBitmap = true;
			titleBm.y = 36;
			titleBm.x = 45 + (_titleShade.width - titleBm.width)*.5;
			_titleShade.filters = [FiltersEnum.COOKTIMEALERT_TITLE_GLOW_FILTER,FiltersEnum.COOKTIMEALERT_TITLE_DROPSHADOWFILTER];
			_mMain.addChild(titleBm);
			_titleShade.mask = titleBm;
			
			_descTf.text = d.map_block_description;
			var i:int;
			var unlockRequire:Array = d.unlock_require;
			var len:int = Math.min(PAGE_SIZE, unlockRequire.length);
			var skipAllCostTemp:int;
			var callBackSkipAllTemp:int;//记录可以花cash跳过的价格（打五折后的）
			_completeCount = 0;
			var canCostCashSkip:int;//记录可以花cash跳过的数量
			for(; i <　len; i++)
			{
				enlargeLandItemVec[i].setDataProvider(unlockRequire[i],d);
				if(enlargeLandItemVec[i].isComplete)
					_completeCount++;
				else
				{
					if(enlargeLandItemVec[i].data.cash != 0)
						canCostCashSkip++;
					skipAllCostTemp += enlargeLandItemVec[i].skipCost;
					callBackSkipAllTemp += enlargeLandItemVec[i].callBackSkipPrice;
				}
			}
			for(; i <　PAGE_SIZE; i++)
				enlargeLandItemVec[i].setDataProvider(null,null);
			if(_completeCount == len)
			{
				completeBtn.visible = true;
				skillAllTb.visible = false;
				if(SwitchConfig.isEnableCallBack && SwitchConfig.isEnlargeLandHalfPrice_land_id == d.unlock_map_xy)
					_offArea.visible = true;
				else
					_offArea.visible = false;
				_skipAllPriceArea.setInfo();
			}
			else
			{
				completeBtn.visible = false;
				if(skipAllCostTemp == 0)
					skillAllTb.visible = false;
				else
				{
					if(canCostCashSkip == 1)//只剩下一项未完成，则不打八折｛
						_skipAllOriginalCost = skipAllCostTemp;
					else//跳过所有的价格，打八折后，向上取整
						_skipAllOriginalCost = Math.ceil(skipAllCostTemp * .8);
					if(SwitchConfig.isEnableCallBack && SwitchConfig.isEnlargeLandHalfPrice_land_id == d.unlock_map_xy)//判断是否有召回活动，并且扩下一块地半价
					{
						_offArea.visible = true;
						_skipAllCost = Math.ceil(callBackSkipAllTemp *.8);
						_skipAllPriceArea.setInfo(_skipAllOriginalCost);
						_skipAllPriceArea.area.x = (width - _skipAllPriceArea.wid)*.5;
					}
					else
					{
						_skipAllCost = _skipAllOriginalCost;
						_offArea.visible = false;
						_skipAllPriceArea.setInfo();
					}
					skillAllTb.setText(LanguageManager.getLanguageInfo('BTN_SKIP_ALL_MISSION'),_skipAllCost);
					skillAllTb.draw();
					skillAllTb.x = (width - skillAllTb.width)*.5;
					skillAllTb.visible = true;
					skillAllTb.enable = true;
				}
			}
		}

		public function get dataProvider():MapUnlokData
		{
			return _dataProvider;
		}
		
		private function feedHandler(d:MetaActiveData):void
		{
			ProjectAssistManager.getIntance().feedRequestManager.sendFeedJsGetItem(d.item_id, d.feedRequestId, dataProvider.unlock_map_xy, -1, d.shopItem, [d.shopItem.sName]);
		}
		private function requestHandler(d:MetaActiveData):void
		{
			controller.requestToFriends(FeedRequestManager.REQUEST_TYPE_NEED_MATEIAL,d.feedRequestId,d.item_id,d.shopItem.sName);
		}
		
		private function goHandler(d:MetaActiveData):void
		{
			disappear();
			ProjectAssistManager.getIntance().springboardManager.analyerGoCommand(d.go_command);
		}
		
		/**
		 * 完成扩地
		 * @param e
		 * 
		 */		
		private function completeHandler(e:TextButton):void
		{
			disappear();
			if(_completeCount ==  Math.min(PAGE_SIZE, _dataProvider.unlock_require.length))
			{
				_mapUnlockCallBack(dataProvider,_offArea.visible);
				TweenLite.delayedCall(.5,controller.showEnlargeLandSuccessAlert,[dataProvider]);
			}
		}
		
		/**
		 *花钱跳过所有 
		 * @param e
		 * 
		 */		
		private function skillAllHandler(e:TextButton):void
		{
			enableBtn(false);
			if(!controller.skipHandlerWithEnlargeLand(_dataProvider,_skipAllCost))
				enableBtn(true);
		}
		
		/**
		 *花钱跳过此项 
		 * @param d
		 * 
		 */		
		private function skipUnlockMapItemHandler(d:EnlargeLandItem,cost:int):void
		{
			enableBtn(false);
			if(!controller.skipHandlerWithEnlargeLand(_dataProvider,cost,d.data))
				enableBtn(true);
		}
		
		/**
		 *将界面上的按钮设为可用/不可用 
		 * @param b
		 * 
		 */		
		private function enableBtn(b:Boolean):void
		{
			skillAllTb.enable = b;
			var i:int;
			for(; i < PAGE_SIZE; i++)
				enlargeLandItemVec[i].enableSkipBtn(b);
		}
		
		private var _controller:SceneAlertManager;
		
		public function get controller():SceneAlertManager
		{
			return _controller;
		}
		
		public function set controller(value:SceneAlertManager):void
		{
			_controller = value;
		}
	}
}
import code.structure.manager.loader.DllLoaderManager;
import code.structure.manager.assist.ProjectAssistManager;
import code.structure.manager.font.FontManager;
import code.structure.manager.language.LanguageManager;
import code.structure.module.config.data.MapUnlokData;
import code.structure.module.config.data.MetaActiveData;
import code.tools.commponents.Component;
import code.tools.commponents.HBox;
import code.tools.commponents.Helpers;
import code.tools.commponents.OriginalInfo;
import code.tools.commponents.VBox;
import code.tools.commponents.button.BuyBtn;
import code.tools.commponents.button.TextButton;
import code.untils.ItemTypeConst;
import code.untils.SwitchConfig;
import code.untils.UiNameConst;

import com.greensock.TweenLite;
import com.greensock.easing.Back;

import flash.display.DisplayObjectContainer;
import flash.display.MovieClip;
import flash.display.SimpleButton;
import flash.display.Sprite;
import flash.events.MouseEvent;
import flash.text.StyleSheet;
import flash.text.TextField;
import flash.text.TextFieldAutoSize;
import flash.text.TextFormat;

class EnlargeLandItem extends Component
{
	private static const LAND_CONDITION_COIN:int = 56001;
	private static const LAND_CONDITION_GOLD_STAR:int = 56010;
	private static const LAND_CONDITION_PINK_STAR:int = 56011;
	private static const LAND_CONDITION_FANS:int = 56006;
	private static const LAND_CONDITION_LOVE:int = 56003;
	
	private var _styleSheet:StyleSheet = new StyleSheet();
	private var _icon:Sprite;
	private var _normalDescTf:TextField;
	private var _hoverDescTf:TextField;
	/** 数量  */
	private var _numTf:TextField;
	private var completeIcon:Sprite;
	private var helpBtn:SimpleButton;
	private var skipBtn:BuyBtn;
	private var vb:VBox;
	private var requestTb:TextButton;
	private var feedTb:TextButton;
	private var goTb:TextButton;
	private var numTextformat:TextFormat;
	private var view:MovieClip;
	
	/** 折扣----原跳过价格 */
	private var _skipPriceArea:OriginalInfo;
	/** 折扣----原需达到的条件*/
	private var _originalRequireArea:OriginalInfo;
	
	private var _originalHb:HBox;
	
	private var _skipUnlockMapItemHandler:Function;
	private var _requestHandler:Function;
	private var _feedHandler:Function;
	private var _goHandler:Function;
	function EnlargeLandItem(parent:DisplayObjectContainer,skipUnlockMapItemHandler:Function,feedCall:Function,requestCall:Function,goHandler:Function)
	{
		_skipUnlockMapItemHandler = skipUnlockMapItemHandler;
		_feedHandler = feedCall;
		_requestHandler = requestCall;
		_goHandler = goHandler;
		super(parent);
	}
	
	override protected function init():void
	{
		setSize(415,98);
		super.init();
	}
	
	override protected function addChildren():void
	{
		super.addChildren();
		view = new (DllLoaderManager.getInstance().getMaterial(UiNameConst.PANEL_VIEW,'enlargeItemView')as Class)as MovieClip;
		addChild(view);
		
		_normalDescTf = view.getChildByName('missionDesc_text')as TextField;
		_normalDescTf = Helpers.replaceTf(_normalDescTf,FontManager.getInstance().embeddedFontCName);
		_hoverDescTf = Helpers.FormatTextField(view,_normalDescTf.x,_normalDescTf.y,_normalDescTf.width,TextFieldAutoSize.LEFT,_normalDescTf.textColor,FontManager.getInstance().embeddedFontCName,14);
		_hoverDescTf.mouseEnabled = false;
		_hoverDescTf.wordWrap = true;
		_hoverDescTf.alpha = 0;
		/* 完成的数量  */
		_numTf = view.getChildByName('num_text')as TextField;
		_numTf = Helpers.replaceTf(_numTf,FontManager.getInstance().embeddedFonDName,true,true);
		/* 已经完成的icon */
		completeIcon = view.getChildByName('completeIcon')as Sprite;
		helpBtn = view.getChildByName('btn_help')as SimpleButton;
		helpBtn.addEventListener(MouseEvent.ROLL_OVER,helpHoverHandler);	
		
		vb = new VBox(view,320,15);
		skipBtn = new BuyBtn(vb,0,0,BuyBtn.BUY_STYLE_CASH,skipHandler,BuyBtn.BTN_FILTERS_NONE,87,26,.9,15,-3,true);
		requestTb = new TextButton(vb,0,0,LanguageManager.getLanguageInfo('BTN_REQUEST'),requestHandler,TextButton.TEXTBUTTON_STYLE_GREEN2,88,26)
		feedTb = new TextButton(vb,0,0,LanguageManager.getLanguageInfo('BTN_POST'),feedHandler,TextButton.TEXTBUTTON_STYLE_YELLOW2,88,26)
		goTb = new TextButton(vb,0,0,LanguageManager.getLanguageInfo('BTN_GO'),goHandler,TextButton.TEXTBUTTON_STYLE_GREEN2,88,26)
			
		_originalHb = new HBox(view,_normalDescTf.x);
		/** 折扣----原需达到的条件*/
		 _originalRequireArea = new OriginalInfo(view.getChildByName('originalRequireArea')as Sprite,LanguageManager.getLanguageInfo('DESC_ORIGINAL_REQUIRE'),14,0x986A12);
		 /** 折扣----原跳过价格 */
		 _skipPriceArea = new OriginalInfo(view.getChildByName('skipPriceArea')as Sprite,LanguageManager.getLanguageInfo('DESC_ORIGINAL_CASH'),14,0x986A12);
		 _skipPriceArea.area.parent.removeChild( _skipPriceArea.area);
		 _originalRequireArea.area.parent.removeChild( _originalRequireArea.area);
		 _skipPriceArea.area.y = _skipPriceArea.area.x = 0;
		 _originalRequireArea.area.y = _originalRequireArea.area.x = 0;
		 _originalHb.addChild(_originalRequireArea.area);
		 _originalHb.addChild(_skipPriceArea.area);
	}
	
	public function setDataProvider(d:MetaActiveData,mapUnlockData:MapUnlokData):void
	{
		_dataProvier = d;
		if(d == null)
		{
			visible = false;
			return;
		}
		/* 根据扩地条件类型 ，加载 icon  */
		var key:String = UiNameConst.PANEL_VIEW;
		var subKey:String;
		var type:String = 'swf';
		var title:String;
		requestTb.visible = false;
		feedTb.visible = false;
		goTb.visible = d.go_command != null;
		var needNum:int = d.num;//需要完成的数量
		var needCost:int = d.cash;//跳过所需花费
		var Str:String = '';
		if(SwitchConfig.isEnableCallBack && SwitchConfig.isEnlargeLandHalfPrice_land_id == mapUnlockData.unlock_map_xy)
		{
			needNum = Math.ceil(d.num * .5);
			needCost = Math.ceil(d.cash * .5);
			_skipPriceArea.setInfo(d.cash);
			_originalRequireArea.setInfo(d.num);
			Str = LanguageManager.getLanguageInfo('SUPERGIFT_DESCRIPTION_5') + ':';
		}
		else
		{
			_skipPriceArea.setInfo();
			_originalRequireArea.setInfo();
		}
		switch(d.item_id)
		{
			case LAND_CONDITION_COIN:
				subKey = 'coin';
				_normalDescTf.text = Str + LanguageManager.getLanguageInfo('DESCRIPTION_EXPANSION_COIN_REQUIRE',[needNum]);
				_hoverDescTf.text = LanguageManager.getLanguageInfo('DESCRIPTION_EXPANSION_COIN_DESC');
				break;
			case LAND_CONDITION_GOLD_STAR:
				subKey = 'icon_goldStar';
				_normalDescTf.text = Str + LanguageManager.getLanguageInfo('DESCRIPTION_EXPANSION_GOLD_REQUIRE',[needNum]);
				_hoverDescTf.text = LanguageManager.getLanguageInfo('DESCRIPTION_NEW_DESSERT_STAR_DESC');
				break;
			case LAND_CONDITION_PINK_STAR:
				subKey = 'icon_pinkStar';
				_normalDescTf.text = Str + LanguageManager.getLanguageInfo('DESCRIPTION_EXPANSION_PINK_REQUIRE',[needNum]);
				_hoverDescTf.text = LanguageManager.getLanguageInfo('DESCRIPTION_EXPANSION_PINK_DESC');
				break;
			case LAND_CONDITION_FANS:
				subKey = 'icon_fans';
				_normalDescTf.text = Str + LanguageManager.getLanguageInfo('DESCRIPTION_EXPANSION_FANS_REQUIRE',[needNum]);
				_hoverDescTf.text = LanguageManager.getLanguageInfo('DESCRIPTION_EXPANSION_FANS_DESC');
				break;
			case LAND_CONDITION_LOVE:
				key = d.shopItem.sPath;
				subKey = 'ICON';
				_hoverDescTf.text = Str + LanguageManager.getLanguageInfo('DESCRIPTION_EXPANSION_LOVE_DESC');
				_normalDescTf.text = LanguageManager.getLanguageInfo('DESCRIPTION_EXPANSION_LOVE_REQUIRE',[needNum]);
				type = d.shopItem.fileType;
				break;
			default:
				key = d.shopItem.sPath;
				subKey = 'ICON';
				type = d.shopItem.fileType;
				if(d.type == 2)//商铺达到X级
				{
					_hoverDescTf.text = LanguageManager.getLanguageInfo('DESCRIPTION_EXPANSION_SHOP_UPGRADE_DESC');
					_normalDescTf.text = LanguageManager.getLanguageInfo('DESCRIPTION_EXPANSION_SHOP_UPGRADE_REQUIRE',[d.num]);
				}
				else
				{
					if(d.shopItem.iMarketSubType == ItemTypeConst.SUB_RUBBISH_DROP){//铃铛类型(获得机器内的掉落物条件的)
						_hoverDescTf.text = LanguageManager.getLanguageInfo('DESCRIPTION_EXPANSION_SUB_RUBBISH_DROP_' + d.shopItem.iMarketSubType);
						_normalDescTf.text = LanguageManager.getLanguageInfo('DESCRIPTION_EXPANSION_REQUIRE_SUB_RUBBISH_DROP_' + d.shopItem.iMarketSubType);
					}else{//feed request
						_hoverDescTf.text = LanguageManager.getLanguageInfo('DESCRIPTION_EXPANSION_FEED_REQUEST_DESC');
						_normalDescTf.text = LanguageManager.getLanguageInfo('DESCRIPTION_EXPANSION_FEED_REQUEST_REQUIRE',[d.num + '  ' + d.shopItem.sName]);
					}
					
					if(d.feedRequestType == 1)
					{
						feedTb.visible = true;
						feedTb.enable = !d.shopItem.isPost(mapUnlockData.unlock_map_xy);
						requestTb.visible = false;
					}
					else if(d.feedRequestType == 2)
					{
						requestTb.visible = true;
						feedTb.visible = false;
					}
				}
				break;
		}
		DllLoaderManager.getInstance().getMaterial(key,subKey,loadIconHandler,type);
		if(d.size >= needNum || d.isCostSkill)//是否完成
		{
			isComplete = true;
			_skipPriceArea.setInfo();
			_originalRequireArea.setInfo();
		}
		else
		{
			isComplete = false;
			if(needCost < 1)//不允许花钱跳过
			{
				skipBtn.visible = false;
				_skipPriceArea.setInfo();
			}
			else
			{
				skipBtn.cost = needCost;
				skipBtn.visible = true;
				skipBtn.enable = true;
			}
			var numStr:String;
			if(d.type == 2)
				numStr = '0/1';
			else
				numStr = d.size + '/' + needNum;
			_numTf.text = numStr;
		}
		vb.draw(); 
		vb.y = (_height - vb.height)*.5;
		_originalHb.draw();
		_originalHb.y = _normalDescTf.y - 20;
		visible = true;
	}

	public function get data():MetaActiveData
	{
		return _dataProvier;
	}
	
	private var _dataProvier:MetaActiveData;
	/**
	 *返回跳过的花费 
	 * @return 
	 * 
	 */	
	public function get skipCost():Number
	{
		if(isComplete)return 0;
		return _dataProvier.cash;
	}
	/**
	 * 返回打完五折后的价
	 * @return 
	 * 
	 */	
	public function get callBackSkipPrice():Number
	{
		if(isComplete)return 0;
		return skipBtn.cost;
	}
	
	public function enableSkipBtn(b:Boolean):void
	{
		skipBtn.enable = b;
	}
	
	private function skipHandler(e:BuyBtn):void
	{
		e.enable = false;
		_skipUnlockMapItemHandler(this,skipBtn.cost);
	}
	
	private function requestHandler(e:TextButton):void
	{
		_requestHandler(data);
	}
	private function feedHandler(e:TextButton):void
	{
		e.enable = false;
		_feedHandler(data);
	}
	private function goHandler(e:TextButton):void
	{
		_goHandler(data);
	}
	private function helpHoverHandler(e:MouseEvent):void
	{
		_originalHb.visible = false;
		TweenLite.killTweensOf(_normalDescTf);
		TweenLite.killTweensOf(_hoverDescTf);
		
		_hoverDescTf.y = 0;
		_hoverDescTf.alpha = 0;
		TweenLite.to(_hoverDescTf, 0.5, {y:(_height - _hoverDescTf.textHeight)*.5,alpha:1,ease:Back.easeOut});
		
		_normalDescTf.y = 29;
		_normalDescTf.alpha = 1;
		TweenLite.to(_normalDescTf, 0.3, {y:0,alpha:0});
		helpBtn.addEventListener(MouseEvent.ROLL_OUT,helpOutHandler);		
	}
	
	private function helpOutHandler(e:MouseEvent):void
	{
		_originalHb.visible = true;
		TweenLite.killTweensOf(_normalDescTf);
		TweenLite.killTweensOf(_hoverDescTf);
		
		_hoverDescTf.y = (_height - _hoverDescTf.textHeight)*.5;
		_hoverDescTf.alpha = 1;
		TweenLite.to(_hoverDescTf, 0.3, {y:0,alpha:0});
		
		_normalDescTf.y = 0;
		_normalDescTf.alpha = 0;
		TweenLite.to(_normalDescTf, 0.5, {y:29,alpha:1,ease:Back.easeOut});
	}
	
	private var _isComplete:Boolean;

	public function get isComplete():Boolean
	{
		return _isComplete;
	}

	public function set isComplete(value:Boolean):void
	{
		_isComplete = value;
		if(value)
		{
			_numTf.visible = false;
			completeIcon.visible = true;
			vb.visible = false;
		}
		else
		{
			_numTf.visible = true;
			completeIcon.visible = false;
			vb.visible = true;
		}
	}
	private function loadIconHandler(c:*,key:String = ''):void
	{
		clearIcon();
		_icon = Helpers.drawBmd(c,_icon);
		_icon.x = 10;
		_icon.y = (_height - _icon.height)*.5;
		view.addChild(_icon);
		view.addChild(_numTf);
	}
	
	private function clearIcon():void
	{
		if(_icon && view.contains(_icon))
		{
			view.removeChild(_icon);
			_icon = null;
		}
	}
}